{#

 This file is part of the FOSCommentBundle package.

 (c) FriendsOfSymfony <http://friendsofsymfony.github.com/>

 This source file is subject to the MIT license that is bundled
 with this source code in the file LICENSE.

#}

{% set depth = depth|default(0) %}
{% set view = view|default('tree') %}

{% for commentinfo in comments %}
    {% include "IMTCommentBundle:Comment:comment.html.twig" with { "children": commentinfo.children, "comment": commentinfo.comment, "depth": depth, "view": view } %}
{% endfor %}

{% if depth == 0 %}
{#     {% if fos_comment_can_edit_thread(thread) %}#}
{#     <div class="fos_comment_thread_commentable">#}
{#         <button data-url="{{ url('fos_comment_edit_thread_commentable', {'id': thread.id, 'value': not thread.commentable}) }}" class="fos_comment_thread_commentable_action">#}
{#             {{ (thread.commentable ? 'fos_comment_thread_close' : 'fos_comment_thread_open') | trans({}, 'FOSCommentBundle') }}#}
{#         </button>#}
{#     </div>#}
{#     {% endif %}#}

{#     {% set count = thread.numComments %}#}
{#     <h3>{% transchoice count with {'%count%': count} from "FOSCommentBundle" %}fos_comment_thread_comment_count{% endtranschoice %}</h3>#}
        
    {% if fos_comment_can_comment_thread(thread) %}
        {% render "IMTCommentBundle:Thread:newThreadComments" with {"id": thread.id} %}
    {% endif %}
{% endif %}
